package com.dy.design_pattern_study.interpreter_pattern.dome1;

import com.dy.design_pattern_study.interpreter_pattern.dome1.impl.NonterminalExpression;
import com.dy.design_pattern_study.interpreter_pattern.dome1.impl.TerminalExpression;

import java.util.ArrayList;
import java.util.List;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-23
 * @Content
 */
public class client {
    public static void main(String[] args) {
        Context context = new Context();
        List<AbstractExpression> list = new ArrayList<>();
        list.add(new TerminalExpression());
        list.add(new NonterminalExpression());
        list.add(new TerminalExpression());
        list.add(new TerminalExpression());

        for (AbstractExpression exp : list) {
            exp.interpret(context);
        }
    }
}
